<template>
  <div>
    <el-table :data="tableData" stripe style="width: 100%">
      <el-table-column prop="xmbId" label="ID号" width="80"> </el-table-column>
      <el-table-column prop="xmbTitle" label="标题" width="300">
      </el-table-column>
      <el-table-column prop="xmbText" label="内容"> </el-table-column>
      <el-table-column prop="xmbImg" label="图片" width="300">
      </el-table-column>
      <el-table-column prop="xmbTime" label="发布时间" width="150">
      </el-table-column>
      <el-table-column prop="xmbCon" label="浏览次数" width="80">
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="100">
        <template slot-scope="scope">
          <el-button
            type="text"
            size="small"
            @click="handleEdit(scope.$index, scope.row)"
            >编辑</el-button
          >
          <!-- 分割线 -->
          <el-divider direction="vertical"></el-divider>
          <el-button
            size="small"
            type="text"
            @click="handleDelete(scope.$index, scope.row)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          xmbId: "",
          xmbTitle: "",
          xmbImg: "",
          xmbTime: "",
          xmbCon: "",
          xmbText: "",
        },
      ],
    };
  },
  created() {
    const _this = this;
    this.axios({
      method: "get",
      url: _this.baseUrl()+"queryXmb6",
    }).then(function (resp) {
      console.log(resp.data);
      console.log(_this.tableData);
      _this.tableData = resp.data;
    });
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    },
  },
};
</script>

<style>
</style>